package com.bidepan.interDemo;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestUserDao {
    public static void main(String[] args){
        ApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");
        //根据接口类型获取其实现类对应的bean
        UserDao userDao = context.getBean(UserDao.class);
        System.out.println("根据接口类型获取其唯一实现类对象为："+userDao);
        userDao.run();
    }
}
